package com.ljl.springbootdemo.service.Impl;

import com.ljl.springbootdemo.dao.UserDao;
import com.ljl.springbootdemo.pojo.User;
import com.ljl.springbootdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao mapper;
    @Override
    public void save(User user) {
        System.out.println("ser保存"+user);
        mapper.save(user);
    }

    @Override
    public List<User> findAll() {
        List<User> all = mapper.findAll();
        System.out.println("service"+all);
        return all;
    }
}
